l1 = [
    {'id':1, 'name':'iphone', 'price':8000},
    {'id':2, 'name':'mac', 'price':12000},
    {'id':3, 'name':'ipad', 'price':3000},
    {'id':4, 'name':'watch', 'price':3000},
    {'id':5, 'name':'airpods', 'price':2000},
]

ids = [item['id'] for item in l1]
id = 5
if id in ids:
    print('存在')
    print(l1[ids.index(id)])
else:
    print('不存在')